<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>节点管理</title>
<link rel="stylesheet" href="__PUBLIC__/js/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="__PUBLIC__/js/ztree/css/demo.css" type="text/css">
<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ztree/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ztree/js/jquery.ztree.excheck-3.5.js"></script>

<script type="text/javascript">
var setting = {
		//数据是否采用简单 Array 格式，默认false
		data: {
				simpleData: {
					enable: true
				}
			},
		//在isSimpleData格式下，当前节点id属性
		check: {
			enable: true
		}
	};
	var zTree;
	var treeNodes;
	$(document).ready(function() {
		$.ajax({
			async : false,
			cache : false,
			type : 'POST',
			dataType : "json",
			//请求的action路径
			url : "{:U('Rbac/getNotesJson')}",
			//请求失败处理函数   
			error : function() {
				alert('请求失败');
			},
			//请求成功后处理函数。
			success : function(result) {
				//把后台封装好的简单Json格式赋给treeNodes 
				treeNodes =  result;
				$.fn.zTree.init($("#tree"), setting, treeNodes);
			}
		});
	});

</script>

</head>
<body>
<div class="zTreeDemoBackground left">
		<ul id="tree" class="ztree"></ul>
</div>
</body>
</html>